<template>
  <div>
    <h2>状态管理Vuex</h2>
    <div>-----------</div>
    <div>{{msg}}</div>
    <button @click="change">点击</button>
    <h2>移动端组件vant</h2>
    <p>
      <van-button type="default">默认按钮</van-button>
      <van-button type="primary">主要按钮</van-button>
    </p>
    

    <van-cell is-link @click="showPopput">展示弹出层</van-cell>
    <van-popup position="left" v-model="show" :style="{height: '100%'}">
      <div>
        我是弹出层
      </div>
    </van-popup>
  </div>
</template>

<script>
import axios from 'axios'
axios.defaults.baseURL = 'https://m.ctrecruit.cn'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.interceptors.request.use(function(config){
  console.log(config)
  return config
})
export default {
  data(){
    return{
      msg:'123',
      show: false
    }
  },
  mounted(){
    axios.get('/plus/lczm_list.php', {
      params: {
        action: 'namelist',
        ajax: 'load',
        zhuangtai: '',
        page: 1,
        pagesize: 10,
        orlist: 'new',
        zhuangtaierji: '',
        diqu:'',
        zhaomuzt: ''
      }
    }).then(data =>{
      console.log(data)
    })
  },
  methods: {
    showPopput(){
      this.show = true
    },
    change(){
      // 修改公共数据
      this.$store.dispatch('inc', 10000)
      this.msg = this.$store.state.num
    }
  }
}
</script>

<style>

</style>